Refactoring, ORM updates