Reorganise the code.