upgrade mongooseModel to optimized generator