Improved statistics plugin