Reorganise code.