Moved some of the stuff from sinatra to rail