Some template cleanups