refactoring with properties