Moved dereferencing out of registry file.