additional attempts at implementing templating