refactored verify prototype