Refactoring zsh generator