converts viewer into class.  Cleaner code for manipulation