refactor, add cli, add module pattern