refactoring of the bakery