move functions to util folder