refactor transformation