big refactoring which also introduces Elo model