More template black magic