update some code for tools