remove global functions from sinatra code