     return exchangeToken(with: params, completion: completion)
   }
   
-  private func exchangeToken(with params: [String : Any], completion: @escaping (Result<Bool, Error>) -> Void) -> URLSessionTask? {
+}
+
+// MARK: - Private Functions
+
+fileprivate extension Trakt {
+  
+  func exchangeToken(with params: [String : Any], completion: @escaping (Result<Bool, Error>) -> Void) -> URLSessionTask? {
     let res = resource(for: "/oauth/token", params: params, method: .post, parse: parseToken)
     return load(resource: res, authenticated: true) { [weak self] result in
       switch result {

    return exchangeToken(with: params, completion: completion)
  }
  
  @discardableResult private func exchangeRefreshToken(_ completion: @escaping (Result<Bool, Error>) -> Void) -> URLSessionTask? {
    
    guard let token = token else {
      completion(.failure(buildError(with: .unauthorized)))

    return components.url
  }
  
  // MARK: - Access Token Endpoints
  
  @discardableResult
  public func exchangeAccessToken(with code: String, completion: @escaping (Result<Bool, Error>) -> Void) -> URLSessionTask? {
    let params = [
      "client_id": credentials.clientID,
      "client_secret": credentials.clientSecret,
