Refactor the SpaceManager