first attempt at templating