statistics refactored