cleaned code for parent applet