You are right, that is the reason I wanted to create a ticket to not forget about refactoring this function. So we can have a ticket (and a merge) just for the refactoring of this function. It would be better than mix both changes (lists and refactoring) in the same commit.

If not, we have to wait for Petro, I think he is the one who implemented this function.