Refactorated templatepanl & documentview +