The world of the mobile devices involves restrictive features. Multiple efforts have been done to define the User Interface. Here, it is combined a neutral description of the UI with a semantic recovery of information. The focus of this paper is the generation of the containment structure based on the context of the application. The process includes three main tasks: first a fixed division of the neutral definition of the UI (a task tree), Then heuristic rules based on the vicinity are applied and finally a set of container patterns is provided to polish the UI. Alternative configurations are delivered and weighted. Since multiple metrics has been proposed a comparison of them was delivered. The results of the comparative analysis suggest that some metrics, although more sophisticated and fine-grained, do not necessarily improve significantly the quality of determining user interface containers, therefore stemming for simple, yet efficient, metrics used to reach a threshold. Finally, as final result is a set of plausible UIs is delivered.