traits and pattern matching changes