Move redeemCode to seperate function