Refactoring ORm section