Factorized building query comparison
Merge branch 'feature/code_duplication' into develop