Slight refector of zengrid_stats_helper.rb code