zsh: refactor