strict handling of forest type
factor category processing into a util function