Re-organise the code.