Port Java examples and base conceptions to JavaScript from the Martin Fowler's Refactoring book