refactor of the reference attribute handling in Test-Resource