There's nothing more permanent than a temporary hack.
Programs, like people, get old. We can’t prevent ageing, but we can understand its causes, limit its effects and reverse some of the damage.
The cardinal rule of writing unmaintainable code is to specify each fact in as many places as possible and in as many ways as possible.
Source code available @ githubpull requests are more than welcome ;-)