validator is now refactored to use events