Move forking and looping run logic to application.