Removed a lot of unnecessary code, improved Registry.