Refactoring with anonymous wrapper