Reorganises code slightly before commenting.