more cloudinit refactoring/fixes