code clean up and only show stats on localhost