Declare variables at the top, as requested.
Merge pull request #181 from mactalla/async-notifications

Declare variables at the top, as requested.