minor improvement of label generation.