use NSMutableSet instead of NSMutableArray and refine some codes