Huge refactorisation. Almost. It doesn't work.