Small improvement to runtime saving stats info into database