Commit before refactor
Refactoring completed, omit select only joins in count query, started to fix array transformation to avoid redundant transformations