using templated function