Refactor accumulator to not require type