Substitution framework