Changed code to avoid setting node properties in multiple locations