changed js structure.