Moving template rendering into a util file.