Added a listen on the tree of applications.
Code beautified.