code refactorisation