Use proper jQuery functionalities, per @gibson042 + more reduction