Refactor method that merges user profiles

Change-Id: I48719f19f109b8504abea88c1f269842da6d57f2
Merge "Refactor method that merges user profiles"