move raw data to its own functions