On the Interplay of Technical Debt and Legacy