It’s something of a running joke that, you hand existing code to a developer, that developer will stay up all night completely re-writing it. I wish I could say it was completely a joke but, not only have I seen it happen numerous times, I’ve done it.
Counter-intuitively, some developers find it easier to use an existing application as a storyboard for a re-write rather than simply digging into the existing code. This is because programming is not only an extremely mental activity, it is quite psychological as well. When you are asked to take over existing code, as has happened to me a few time recently, you are not only learning the code, you are are also become familiar with how the previous developer(s) approached problem solving. You must train yourself to think like the previous developer in order to understand their approach.