Improved registration code