moved out general funcs to utils file