Cleaned up the messiest code I wrote so far by writing a loop. I
didn't do this earlier because the asynchronous nature of content
loading execution was causing my earlier loops to fail.