refactor to a sinatra::base app