refactored template rendering logic to _render_template method, this way
the view is free to change the data in the last minute before being
rendered