making sure base_path will be handled by router
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