Factorize List* related code.