Improve constraint handling mechanism.