Refactorin a smell code through 3 cases