cleaned up package handling