Re-ordered some code to make the main thread's work go in parallel with back-end work