Cleaning up substitutes code.