factor out package stuff