Improved handling templates and objects