cleanup ref to viewer
much better context validation