Scala TriCnt pattern matching refactor