Add function decorator to keep the cmd commands DRY.
Ran pep8 for code style