Refactor dup edge removal in seprate function