More media querey work

removed some test quereys and cleand up the code.