optimize Rule implementation