Refactoring and testing, bugfixing of answer poll