improve time for processing each case