Added code to handle ExtraMessage received as intent. Minor code restyling