clean up data handling