Revert "bug fix."

This reverts commit 46029a996f110063613991f8247c5319ba599520.
Revert "refractor data reader"

This reverts commit d59b3d28f1a3cb320d7d15a2db9776c03e44089c.
bug fix