**Description** Loop used in the processing of consumed records is far too large and complicated. Refactor the DatabaseOutput class using OOP principles.