Making it work with template engine