changed Listener, Heartbeat, and Pulse to inner classes