move cli parser code to separate class