Refactored histogram