generalized listener for local or public