I think it might be more readable to go with simple if/else blocks here rather than pattern matching.