command line interaction, refactor into classes