updated logic to support applications
Merge branch 'topic-context-manipulation' into topic-example
updated logic to support applications