Separated monitor and event handler into two separate threads