light refactoring of QueriesController