rewrote render tag using more succinct and idiomatic way