Added dynamic templating

Why the hell wasn't this done earlier?