generate segment classes