Reorganised code.