Refactor of DataSourceManager for scope management