What Is Refactoring?What Is Software Architecture?Good Architectures Are PredictableGood Architectures Promote Code ReuseGood Architectures Are ExtensibleGood Architectures Are MaintainableSoftware Architecture and RefactoringShortcomings that Lead to RefactoringChanging RequirementsPoorly Designed ArchitectureUnderestimating DifficultyIgnoring Best PracticesWhen Should Code Be Refactored?When Should Code NOT Be Refactored?Am I Allowed to Refactor My Code?Refactoring ExamplesRefactoring Example 1: Calculating the Total Price of an Ecommerce OrderRefactoring Example 2: A Simple Example of Refactoring CSSChapter Summary