do some prepare work.