     /// - Returns: True if a session is currently available, false otherwise.
 
     public func isSessionValid() -> Bool {
-        return keychain.get(Keychain.key) != nil
+        return retrieveAccessToken() != nil
     }
 
     /// Ends the current session.

    }

    private enum Keychain {
        static let key = "accessToken"
    }

    // MARK: - Properties

    private let urlSession = URLSession(configuration: .default)
    private let keychain = KeychainSwift()
    private let decoder = JSONDecoder()

    private var client: InstagramClient?

    public func login(from controller: UINavigationController, withScopes scopes: [InstagramScope] = [.basic], success: EmptySuccessHandler?, failure: FailureHandler?) {
        if let authURL = buildAuthURL(scopes: scopes) {
            let vc = InstagramLoginViewController(authURL: authURL, success: { accessToken in
                if !self.storeAccessToken(accessToken) {
                    failure?(InstagramError(kind: .keychainError(code: self.keychain.lastResultCode), message: "Error storing access token into keychain."))
                } else {
                    controller.popViewController(animated: true)
