refactor data provider.