Improved authorization flow