cleanup notification code
Merge pull request #42 from mathisonian/master

code cleanup and error handling for notifications