small cleanup for cast template
Merge pull request #2 from ignatov/cast

small cleanup for cast template