avoid to do pattern matching with types