The method is too long and it is handling too many logic inside, also is returning diferent types of data, arraysm, booleans can we split this method in smaller methods