restructure mongo queries, move to model file