restructured cpp layout