refactor and add space_bar