Refactor program into rackup configuration, models and api.