Reorganised JS variable declarations