Refactored ORM class