clean up tool util function