refactoring data driven