common functions in common.sh.