refactor into a simple sinatra app