refactoring util.