fix: expired longpoll; fix: exit application; *refactoring