refactoring of Bet class v2