improved labels handling