Refactor into an index
Update to match latest sugar-build config