refactor spaces