Do preprocessing in a background job rather than on the UI thread.