Added template loading support