beginning of templating --KW