Changing declared names by pattern