better performance for function matching