refactored labeling