ZSH: refactoring