Refactoring bash-completion