OO refactoring using dojo