[backend] improve/cleanup linked package handling a bit