restructuring of js and pages