small cleanups in functions.sh