refactoring bootcamp statistics methods