refactored mongoose model