ORM refactoring to DM