refactoring dataservice