abstract out data processing