Refactored activity signal listener