Re-factored to be able to use rackup.