Template integration

resolves #38