Refactor all command related functionality into Command object