unblock earlier
use onload instead of onloadend because we want only successful loads
faster to use onResultReceived callback
document and improve code flow a bit