Refactor contracts and tweak design (breaks build)