refactored the proposed wager code