Refactor Histogram