added private segment class for better name and id handling
added test for named segments