modularize viewer