Refactor LotteryScheduler.java