Make better use of jquery selectors instead of using a conditional