2 snippets for query builder. Controller use defenitions