some js rile reorganisation