Ah. Well, I don't think I could improve what I have much. What you don't see is that these two separate subroutines are called by separate AJAX functions under differing conditions, and that they each have a non-overlapping functionality along with what certainly does appear to be redundant at first glance. Note the comments given to each function, and note that they differ in terms of the password handling as well. While the actual DB query is essentially the same, updating a password, it is vetted in two distinct ways: one is an administrative reset of another member's password, while the other is the user changing his or her own password. Neither of these functions will happen more than rarely.