Merge pull request #1038 from rustyswayne/Refactor/M-502

Adds query model factories