Adding a verify class and refactoring main code block