refactored the definition of space.