LPS-46486 Query reference elements with the proper class