Refactor redeemed() to redeemCode() and add dispatch command code into the redeemCode() method