refactored reader class