1. A method in a web engine configured for an IPTV Terminal Function comprising an application framework associated with an Application Programming Interface enabling display of applications, the method comprising: storing at least two applications, wherein the applications are arranged in a hierarchical tree structure in relation to each other, receiving an event targeting at least one application, and controlling dispatching of the received event targeting at least one application, wherein the controlling further comprises dispatching the received event to a target application, determining for each application if the event should be processed by the current application and if it should be processed, then the method comprises processing the event for the current application and if it should not be processed then the method comprises dispatching the event to a subsequent application in the hierarchical tree structure.