rewritten rules transformation