Modified conditional statements to reduce code.