Fix query and css refactoring