Fed, provincial govts working to eliminate extremism, terrorism: Ahsan