remove unnecessary tokens from rules