refactoring SO polling code slightly, added config settings