Moved listener inline for readability