refactors pkg