CLI refactor tool