Simplifies JS Code