Used an anonymous class to avoid users backward incompatibilities and side effect with users that would addAttachHandlers