add boilerplate code for new statistics table
code cleanup
factor histogram code out of view class