Significantly reduce size of match method