refuctoring login page