add subcommand to cli, domains management and start to clean code