modified to extend base template