Reorganized the entity system.