moved util functions to utils file