viewport editable
more templating and cleanup