Create subcommand system
Refactor variable names and other code