JS reorganization