added tests for match type, and removed switch/case