improve template/cpp