Added support for Notify my Android application, and refactored some parts of the code