massive refactoring, model rewriting, initDB method at startup