Remove duplicated code by using a loop
Check for existing object and warn before creating
Update to version v635