moving more utility functions to util.sh