Merge redundant code