refactor to fit the emitter approach + add tests using TextStripper