Last three values sfdc trigger functionalty Please review the following salesforce trigger code

trigger BrandTrigger on Brand__c (before update) {
    for(Brand__c brand: Trigger.new){
        Brand__c oldBrand = Trigger.oldMap.get(brand.Id);
        if (oldBrand.Name != brand.Name) {

            if(String.isBlank(oldBrand.Old_Name__c)){
                brand.Old_Name__c = oldBrand.Name;
            }else{
                brand.Old_Name__c = split(oldBrand.Name + ', ' + brand.Old_Name__c );
            }
        }
    }

    private String split(String s) {
        Integer index = 0;
        for (Integer i = 0; i &lt; 3; i++)
            index = s.indexOf(', ', index + 1);

        if(index &gt; 2)
            return s.substring(0, index);
        else
            return s;
    }
}


Trigger sets at least three values ​​in the "Old Value" field. These are the historical values ​​of Brand_c.Name
You should try to keep the logic out of the trigger itself and try to put it into a handler class. This goes along with the one trigger per object pattern. What would happen if you needed to add another trigger on the same object that performed logic after update or before insert?
It looks like you might be replicating standard functionality with your split function. Make sure the standard split method not will meet your needs.