Refactored ORM core functionality to increase speed.