made template/snippet handler function optional