Complete #239 implementation