Refactor If / If-Else tests.

Add variables to make the conditionals less static and pointless-looking.