Tried to make MatchState very slightly more performant by removing lambdas but it doesn't appear to have helped much.