Refactoring bash_completion