further implementation of render-template