better API for entry and exit handlers (no need to class base class implementation)