refactoring with objects wrapper