Remove empty list inside templates

Added ClearList method