Moved all the common functions to util module