updating js structure