Fancy templated helpers.