diff --git a/app/models/foreman_uuid_boot/uuidboot_host_facet.rb b/app/models/foreman_uuid_boot/uuidboot_host_facet.rb
index 79756b7c0d8d034208369388468220a02cea0d16..49cb8b703fa83c2433ab237e9b056a38afa60474 100644
--- a/app/models/foreman_uuid_boot/uuidboot_host_facet.rb
+++ b/app/models/foreman_uuid_boot/uuidboot_host_facet.rb
@@ -5,10 +5,17 @@ module ForemanUuidBoot
     include Facets::Base
 
     def self.populate_fields_from_facts(host, parser, _type, _proxy)
-      facet = host.uuidboot_facet || host.build_uuidboot_facet
-      facet.uuid = parser.facts.dig('dmi', 'product', 'uuid') || parser.facts['uuid']
-      facet.save if facet.uuid && facet.changed?
-      facet.destroy if !facet.uuid && facet.persisted?
+      uuid = parser.facts.dig('dmi', 'product', 'uuid') || parser.facts['uuid']
+
+      if uuid
+        facet = host.uuidboot_facet || host.build_uuidboot_facet
+        facet.uuid = uuid
+        facet.save if facet.changed? || !facet.persisted?
+        facet
+      else
+        host.uuidboot_facet&.destroy
+        nil
+      end
     end
   end
 end