Use mongoose, structural refactor