passwordType function cleaned up.