refactor of tool class