Improved auth code