Minor refactor and fix autocompletion
Run the commands on enter