Sinatra rewrite