Run template through erb first to make it easier to parse