Multi theading done to get better performance