Fix up design and code logic