mongo schema persistence, refactoring