Motivation:
The "avoid main roads" feature does a good job in finding small roads, but sometimes prefers residential roads, which no human would choose.
There is no easy way to avoid "residential" without sacrificing the routes via the "unclassified" roads.
Problem:
The issue with OSM and small roads is, that many "unclassified" roads are interrupted with "residential" in villages.
(see german discussion)IMHO the "unclassified" roads should be continued inside villages as it is done with the other roads (primary, secondary, tertiary)
Idea for a possible solution:
It might be possible to fill the gaps during the
preprocessing stage of GraphHopper.
See what "Netzwolf" has done hereOn his map you can see where the "unclassified"(blue) ends in a "residential"(red)
You could try to continue those "unclassified" roads in the preprocessing stage of GraphHopper
Whenever an "unclassified" ends in a "residential", replace the "residential" with "unclassified", until you hit the next "unclassified" or higher road.
Definitely not an easy task and with many pitfalls.
Greetings
Manfred