rearrange js scripts