Added custom intents to handle events properly.

Cleaned-up logging also