refactor sinatra side