broke login out into lib