Performs substitution tasks