re-structure of js files