first adjust code structure