Refactored code and added UIWebView suppport