Support for custom template

This resolves #6