templated buffer