Extracted the method to populate the datasource