use function keyword through out the code
From man zsh:
-----------------------------------------------------------------------
Note also the unhelpful interaction of aliases and function defini‐
tions:
alias func='noglob func'
func() {
echo Do something with $*
}
Because aliases are expanded in function definitions, this causes the
following command to be executed:
noglob func() {
echo Do something with $*
}
which defines noglob as well as func as functions with the body given.
To avoid this, either quote the name func or use the alternative func‐
tion definition form `function func'.
-----------------------------------------------------------------------
Therefore make use of the function keyword through out the code for
defining shell functions. Also harmonize its usage, where it is used allready.