Simpler implementation that does not require a listener.