Merge code cleanup