Move transformation function into helpers lib