refactor transformer