Major refactor of entity creation