Improved getting access token