pushed common functions into common.sh