refactor to util