refactorisation and tests creation