split processdatalist() into smaller functions