make processing code a bit more compact/idiomatic
excise some unrelated research code