refactoring stats