Generic distributed thread extracted to its own file. Listener moved to services.