Move logic in to controller out of redeemCode function