Fix technical debt and reduce lines