Added loginValidation. Some cleanup.