moved password input to common code