Add custom template support

Fix #50