Refactoring datasources