Refactored onHandleIntent() to multiple methods.

The method is obviously too long; making each case a method increases readabillity.