First refactor to allow the output of Stats to be turned on and off