refactor create transformer