CPP templates modified