Adjust some code around