Break down rule lookup into two steps