reduce I/O access and memory usage