refactor plugin tools