some stats refactoring