refactor: mongo functions separated