adjust code structure