Package refactoring and housekeeping