The answer to grandfathering things in is not to give them an indefinite examption from the rules; instead, give them, say, a 10 year period of exemption, giving the owner enough time to fix the defect and to spread the expense of doing so over time. It's not perfect, but eventually everything ends up being fixed.