add method and use type match