Refactor access_token retrieve and sessions creation