Simplified the processing loop.