refactor to pass idField