moving common functions to ground