avoid object instantiations and functions calls when rule matching