Code refactoring

Divide login method into shorter methods.
Separate login and IntentService.