Misc. code rewriting for constraints (learning how these work!)
May have negligible impact on performance, does not affect anything else.