The three lines of code in this logic (without line 57) are the same as in registerClassListener (line 148). One could consider extracting one method, although this method would contain data maintenance code and notification code.