[3087] Modified to use templates.

Gist: https://gist.github.com/mjelonek92/bd5c2011302f40cb8972