bunch of code contract changes