refactor the spaces