Would it be possible to do this with autogenerated code from a template?