Updated ERB processing to use local vars rather than instance vars