Refactor that loop from hell

Take it down from over 9000 wtfs per minute to around 3 wtfs per minute