Refactoring of segment classes