Rename template to allow for easier metaprogramming
Use metaprogramming to refactor three similar methods into one
Merge pull request #840 from jacquerie/master

Use metaprogramming to refactor three similar methods into one