moving useful code in seperate utility code