Creating a custom template loader