Refactor listing functions (see [8ad560204])