simplified name saving logic