Lots of code cleanup related to constraints in the reference platform