replace and update as Ruby impls since working with blocks from Java sucks