Core code for contact listing based on IDs.