Refactor some packages