I want to convert this into a more readable for other programmers in the team, but I am not sure how properly refactor this function that merges two dict, and remove duplica