add pattern matching classes