added some more logic tests to the builder

also refactored the builder's verify method and extracted several
subroutines.