Improve the iframe destruction and creation flow
Fix tests