#1806 improved memory usage of ChangeNodeTypeManipulation and ReplaceBranchManipulation by replacing the linq statements