refactored command line tools