Removed test code
Base event loop