Refactoring: Subcommands are separated into the function.