Add some line breaks where appropriate in this code (for example before |var reqPrevious|). It's a bit hard to read as a single block of code.