Chapter 6 : Clean duplicate code