adjust the code structure