move reader to separate file