separated CLI code into its own class and file