Refactor list_all_students