start of refactorisation

as discussed.