Refactors getLabels into utils