rewritten register constraint handling