Refactor to avoid having to emit an event on process directly. Closes #33.