some cleanup. we'll probably keep this simply as-is (same as calc6, but modular)