extract isNameExist func to utlity.func