DRYied main.rb and put templates on views folder