Refactor to seperate generating and calculating stats