Improve code to get values from Registry.