removed unused code. Updated cpp template files