First implementation of templating