refactoring cli.rb, breaking things apart, hopefully simplifying