Additional refactoring. Major fix and re-implementation to Checkout and Histogram