Refactor commands to classes