added simple templating mechanismn