Refactor package refresh a bit