Consolidating svg template logic