Completely refactored command line tool