move enum to top-level scope
refactor into handleEvents out of inputLoop
refactor epoll setup out of inputLoop