Implemented a Commander class, code cleanup