Refactor/fix EventLooper.