Performance logic (in progress). Mongo query moved to a separate method.