create a base handler class to deal with templates