added interface for template and both a file and callback impl