Organise imports and auto-formatting refs #2741