extracted out data manip funcs