Refactors packages