It looks like you need more objects to represent groups of related objects.
new SubmitLogs().mail(IP, date_time_UTC, date_time_IST , pageVisited , userCountry , userRegion , city , userAgent);
It seems that there are several objects awaiting exit.
public class UserLocation { private string userCountry; private string userRegion; private string city;
Now you simplified it a little
new SubmitLogs().mail(IP, data_time_UTC, date_time_IST, pageVisited, userLocation, userAgent);
I donβt know your domain, but maybe you can find other data groups to bring them together.
Once you combine your data, you may find that the methods begin to naturally move to these classes. For example, UserLocation may have a method for writing this information to a stream.
source share