update also for dip offer and refactor some code