Moving statistics code into its own controller