add template support and additional tests for it