Move transform function from a cycle