Move logic to a DICBuilder.

This removes the need to throw an exception.