removed dead code, unified builders, ported to stream over file