Refactored entity addition and removal stuff to EntityManager class. This class should be renamed.