Listings code refactoring