Generalize endpoint extension

in a helper