Simplify the big loop in _process()