Clean up and standardize code for agreements.