Package refactor and other small changes