PLD: move fetching instances into a separate function