Studying design patterns and refactorings in JavaScript