Added replacements, optionalality, and expansion