simplified and improved the AsyncEventQueue and Thread system