Refactored stat system to use factory class