Refactoring

Removed iFrame and refactored code