cleanup extension code