Refactoring to make DOM2Share a class