This allows us to make full use of the event loop to parse keys, and simplifies the code quite a bit.