Structure js better