improve name parse code