Remove duplicated code regarding handling social name