Extract a base template