refactor code read large data