moved more js code to react