models refactoring, compiled queries