Extract message loop.