Added yet another layer of abstraction.
Fixed tests.