collect data and update code