Refactored code for listing.