Refactoring segmented controls