Refacctoring: changed the datamodel for mongoose