implemented Template class