decode packages only when it is necessary