Extracted code into Accumulator.js