cleaned up data string extraction