Refactoring for Applet support