JavaScript All HomeWorks Refactoring