extract login to a separate component