Refactored Listener to allow testing of work normally done in separate
thread.