Added support for templated version.