Refactor packages