Clean templates and add some extra config