Refactoring code
Processing logins errors