Cleaning up + performance improvement by using hash objects for name clash checks.