Refactoring: modules core, cli