added docs and nested helpers