refactored listen.c for clarity
refactored notify.c for clarity