code cleanup : merge code