Fixed #7: Refactoring of login and parsing code