reorganize js loading