Added basic template handling