refactor, add emitter