added generic helper method to display iframes
refactored code