refactor, add cli, module pattern