Website : code refactoring in javascript code