Simplify a lot of code that unnecessarily checks that a jQuery