boost the efficiency by removing file read/write