Refactor stats handling
Merge pull request #9 from ironcladlou/stats-refactor

Refactor stats handling