refactoring: better package handling