Moved data processing to be seperate to packet handling