first pass at converting templates