Project refactoring and ORM WIP