match cases with MatchCaseFactory