Remove debug message
Reorganize code to avoid unnecessary collection expansion
Delete duplicates from collection before completion