Improve stats handling