Added feature to manage the whole substitution plan