How the Factory Pattern Can Reduce Technical Debt