Split transform output into separate function