refactoring js object model part 2