Unify to AppShell and minimalistic defensive good coding practice.

Its not a good example if it throws notices ;)
So I added a minimalistic fallback.