restructuring JS/CSS