Stats - code cleanup