Extract validatePassword