added a new login mechanism much more readable