Assorted (mostly functional) utilities