Revert "Switching to templates"

This reverts commit c774e3d0982982a02f3379654828a518a91d8f7e.