refactor data service