Пример рефакторинга кода на js По мотивам статьи Мартина Фаулера http://martinfowler.com/articles/refactoring-video-store-js/