better code for bets page