moved some code to util