fix tools
big refactor