refactored reader interface to be generator based