Support Filter classes
Clean up code and make Template a little more private