copy code cleanup