remove building struct stuff

no algorithmic changes, this is purely vanity.
i came back to look at this the other day and had a hard
time figuring out what the hell I had done. so hopefully this helps,
this uses parameters and returns so that each function's purpose
can easily be reasoned about from its signature. next time, smack me plz

and i didn't even break the API, only my twisted java ways, yay