bunch of general-purpose functional utilities