added cli and did refactoring