Extracted a createDataReader method and small other changes.