moved views functionality to view.rb