generalized to multiple data sources