further clean up cpp file