refactor toolchain