cleaned up the statistics logger code