Refactored based on the participant's mother p_type. 

#3746