Use pointer as the return type in dictioniay match functions

In order to imporve performance copies need to be reduced.