Implementation & tests.