simplify packagelink code a bit