Using temporary scratch layers