main js segregated