Refactored constructor of SpaceObject class.