Change order of statements
Use keys of hash
Add helper class for writing events
Extract local variable
Use helper class instead of writing to response directly
Extract helper for joining read/write IO arrays
Move encoding responsibility to helper class
Verify behavior of `IO::join`
Merge branch 'extract-io-helper'