Reorganizing js