Refactored match statements to use new expression equality function