Refactor zsh code related functions to Zsh class