data prepare code