Improve constraints logic in windows