Moved the login part into a sperate file