Refactor packges