improve loading. refactor js. add progress bar.