scripts/functions.zsh: update helper functions