Extract uuid snippet into function