This should probably be asynchronous for when we make the move to web workers