Cleans up list_entries_by_id function before enhancement