change newData function signature to allow for more optimization