Refactoring the MediaQuery service.