improve nested relation reference