code review and pdf read logic