preview view template
code cleanup