Chemical modification of preformed polymers