cleanup
refactor CLI tool