Lottery backend improvements