reorganize code because of blink bug so the test doesn't timeout