Refactored login code
Merge pull request #4 from Timalex/development

Refactored login code