Tiny refactors of iframe ready event handling