refactor data provider