code cleanup and DFP ready