spliting up operator and making rule generator more generic