mongoQueries.js refactoring