update code to removed unnecessary data