Refactoring more js in layout and vendor