template and inherit