updated js structure