Slight clean up and simplification of authorization code