Move the entity register to it's own class.