Optimized Mongoose model definition, replace Map and Reduce function with tested ones