Refactor statistics methods to make them more DRY