modularize building zero/one structures
(addendum to last commit- there should have been zeros to cache, but the code doesn't need to be so specialized)