Refactor parameter substitution in RPLs and effects