PLD: modal refactor and tests