split read and write into several modules