code factorization for listing operations