finish factoring out package open/read code into discrete functions