Minor templetization and updates