Extract the login bar into a separate function