Revamping the way we handle outputting templates