refactoring, making things more efficient on the mongo side