Refactor reader ready for threading