 
 extension InfoStrategyArrayLoader
 {
+    // MARK: - Function Types
+    private typealias PageStateForSuccess = (current: PageState<Error>, mutation: Mutation<Bool>) -> PageState<Error>
+    private typealias PageStateForFailure = (current: PageState<Error>, error: Error) -> PageState<Error>
+
+    /// A function type to transform an `InfoLoaderState` value.
+    private typealias InfoLoaderStateTransform =
+        InfoLoaderState<Element, Info, Error> -> InfoLoaderState<Element, Info, Error>
+
+    /// A function type for creating a loader event from a current loader state, a previous loader state, and an array
+    /// of newly-loaded elements.
+    private typealias LoaderEventForStatesAndElements =
+        (LoaderState<Element, Error>, LoaderState<Element, Error>, [Element]) -> LoaderEvent<Element, Error>
+
+    /// A function type for creating a loader event from a current loader state and a previous loader state.
+    private typealias LoaderEventForStates =
+        (LoaderState<Element, Error>, LoaderState<Element, Error>) -> LoaderEvent<Element, Error>
+
+    static func currentIfNoMutation(current current: PageState<Error>, mutation: Mutation<Bool>) -> PageState<Error>
+    {
+        return mutation.value.map({ hasMore in hasMore ? .HasMore : .Completed }) ?? current
+    }
+
+    static func hasMoreIfNoMutation(current current: PageState<Error>, mutation: Mutation<Bool>) -> PageState<Error>
+    {
+        return mutation.value.map({ hasMore in hasMore ? .HasMore : .Completed }) ?? .HasMore
+    }
+
     // MARK: - Load Request Completion
     private typealias PageResult = Result<InfoLoadResult<Element, Info>, Error>
-    private typealias PageStateForSuccess = (current: PageState<Error>, mutation: Mutation<Bool>) -> PageState<Error>
-    private typealias PageStateForFailure = (current: PageState<Error>, error: Error) -> PageState<Error>
-
-    static func currentIfNoMutation(current current: PageState<Error>, mutation: Mutation<Bool>) -> PageState<Error>
-    {
-        return mutation.value.map({ hasMore in hasMore ? .HasMore : .Completed }) ?? current
-    }
-
-    static func hasMoreIfNoMutation(current current: PageState<Error>, mutation: Mutation<Bool>) -> PageState<Error>
-    {
-        return mutation.value.map({ hasMore in hasMore ? .HasMore : .Completed }) ?? .HasMore
-    }
-
+
+    /// Completes loading of the next page.
+    ///
+    /// - parameter result: The result from loading the next page.
     private func nextPageCompletion(result result: PageResult)
     {
         pageCompletion(
             result: result,
             combine: { current, new in current + new } ,
-            pageEventForLoaded: LoaderEvent<Element, Error>.NextPageLoaded,
-            pageEventForFailed: LoaderEvent.NextPageFailed,
+            loaderEventForLoaded: LoaderEvent<Element, Error>.NextPageLoaded,
+            loaderEventForFailed: LoaderEvent.NextPageFailed,
             nextPageStateForSuccess: InfoStrategyArrayLoader.hasMoreIfNoMutation,
             previousPageStateForSuccess: InfoStrategyArrayLoader.currentIfNoMutation,
             nextPageStateForFailure: { _, error in .Failed(error) },

        )
    }

    private func pageCompletion(result result: PageResult,
                                combine: (current: [Element], new: [Element]) -> [Element],
                                pageEventForLoaded: (LoaderState<Element, Error>, LoaderState<Element, Error>, [Element]) -> LoaderEvent<Element, Error>,
                                pageEventForFailed: (LoaderState<Element, Error>, LoaderState<Element, Error>) -> LoaderEvent<Element, Error>,
                                nextPageStateForSuccess: PageStateForSuccess,
                                previousPageStateForSuccess: PageStateForSuccess,
                                nextPageStateForFailure: PageStateForFailure,

        switch result
        {
        case let .Success(loadResult):
            modifyStateForPageCompletion(
                transform: { current in
                    InfoLoaderState(
                        loaderState: LoaderState(
                            elements: combine(current: current.loaderState.elements, new: loadResult.elements),
                            nextPageState: nextPageStateForSuccess(
                                current: current.loaderState.nextPageState,
                                mutation: loadResult.nextPageHasMore
                            ),
                            previousPageState: previousPageStateForSuccess(
                                current: current.loaderState.previousPageState,
                                mutation: loadResult.previousPageHasMore
                            )
                        ),
                        nextInfo: loadResult.nextPageInfo.value ?? current.nextInfo,
                        previousInfo: loadResult.previousPageInfo.value ?? current.previousInfo
                    )
                },
                pageEvent: { current, previous in loaderEventForLoaded(current, previous, loadResult.elements) }
            )

        case let .Failure(error):
            modifyStateForPageCompletion(
                transform: { current in
                    InfoLoaderState(
                        loaderState: LoaderState(
                            elements: current.loaderState.elements,
                            nextPageState: nextPageStateForFailure(
                                current: current.loaderState.nextPageState,
                                error: error
                            ),
                            previousPageState: previousPageStateForFailure(
                                current: current.loaderState.previousPageState,
                                error: error
                            )
                        ),
                        nextInfo: current.nextInfo,
                        previousInfo: current.previousInfo
                    )
                },
                pageEvent: loaderEventForFailed
            )
        }
    }
}
