tidy up and added config to filter templates