This way we can move some of the view logic to the Ruby class. It'll also make it easier to write tests for it.