move code for displaying packages into new function