I'd recommend that you fix the hard coded links and do it the right way rather than force a re-write for code that is written wrong ...