more work removing functions from templates