Any reason the 1st 2 jQuery calls are not moved out of the if (copypasta)?