Removing unnecessary templates