Make dspace a pure function