Updated factory to prevent duplicates