Lotto refactoring