DuettoBackend: Optimize access to unions