Reorg code to avoid endless loop