Refactor function labelL with type List.