version3 rewrite, refactor cli tools