Rewrite transformers, added state transformer