refactor bet.html