add else clause to remove files on boolean: false
remove unused template