helper tools for light-weight functional programming