abstracted command line interface into a class and added test class