utility method to wipe db, and logic for continuously polling messages
refactorings