Refactoring access_token() and refresh() request logic