cpp writers cleanup