Bunch of reorganisations for tests.