Make the option template tag type agnostic

Condensed the logic from #581